package design.patterns.proxymode.staticProxy.service;

import design.patterns.proxymode.staticProxy.api.IDrive;

import java.util.Random;

/**
 * @author ： cww
 * @date : 2018/7/5
 * 1.汽车行驶，实现drive接口
 * 2.并且对行驶计时
 */
public class CarStatic implements IDrive {
    @Override
    public void drive() {
        //模拟实现开车
        try {
            System.out.println("-------------汽车行驶中---------------");
            Thread.sleep(new Random().nextInt(1000));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
